package controllers;

import play.data.validation.*;
import play.*;
import play.mvc.*;
import java.util.*;
import models.*;
import java.io.IOException;
import java.util.Calendar;
import com.ebay.sdk.ApiContext;
import com.ebay.sdk.ApiCredential;
import com.ebay.sdk.ApiException;
import com.ebay.sdk.SdkException;
import com.ebay.sdk.call.AddFixedPriceItemCall;
import com.ebay.sdk.call.AddItemCall;
import com.ebay.sdk.call.EndItemCall;
import com.ebay.sdk.call.GetItemCall;
import com.ebay.sdk.call.GetProductsCall;
import com.ebay.sdk.call.GetSellerListCall;
import com.ebay.sdk.call.GeteBayOfficialTimeCall;
import com.ebay.sdk.util.eBayUtil;
import com.ebay.sdk.TimeFilter;
import com.ebay.soap.eBLBaseComponents.AmountType;
import com.ebay.soap.eBLBaseComponents.BuyerPaymentMethodCodeType;
import com.ebay.soap.eBLBaseComponents.CatalogProductType;
import com.ebay.soap.eBLBaseComponents.CategoryType;
import com.ebay.soap.eBLBaseComponents.CountryCodeType;
import com.ebay.soap.eBLBaseComponents.CurrencyCodeType;
import com.ebay.soap.eBLBaseComponents.DetailLevelCodeType;
import com.ebay.soap.eBLBaseComponents.EndReasonCodeType;
import com.ebay.soap.eBLBaseComponents.ExternalProductCodeType;
import com.ebay.soap.eBLBaseComponents.ExternalProductIDType;
import com.ebay.soap.eBLBaseComponents.FeesType;
import com.ebay.soap.eBLBaseComponents.ItemType;
import com.ebay.soap.eBLBaseComponents.ListingDurationCodeType;
import com.ebay.soap.eBLBaseComponents.ListingTypeCodeType;
import com.ebay.soap.eBLBaseComponents.ProductListingDetailsType;
import com.ebay.soap.eBLBaseComponents.ProductSearchType;
import com.ebay.soap.eBLBaseComponents.ReturnPolicyType;
import com.ebay.soap.eBLBaseComponents.ShippingDetailsType;
import com.ebay.soap.eBLBaseComponents.ShippingServiceCodeType;
import com.ebay.soap.eBLBaseComponents.ShippingServiceOptionsType;
import com.ebay.soap.eBLBaseComponents.ShippingTypeCodeType;
import java.util.Locale;

public class Home extends Controller{
	public static void index() throws ApiException, SdkException, Exception{
		ItemType[] items = null; 
		Api myApi = new Api();
		items = myApi.getAllCurrentItems();
		ArrayList itemList = new ArrayList();
		for(int i=0;i<items.length;i++){
			itemList.add(myApi.viewItem(items[i].getItemID()));
		}
		String user = Security.connected();
		render(user, itemList);
	}
}
